const Router = require('koa-router');
//处理中间件
const {
    verifyUser,
    handlePassword
} = require('../middleware/user.middleware');
//通过处理中间件，处理数据
const {
    create,
    avatarInfo
} = require('../controller/user.controller');

const userRouter = new Router({ prefix: '/users' });

//verifyUser验证用户名密码， handlePassword加密密码
userRouter.post('/', verifyUser, handlePassword, create);
userRouter.get('/:userId/avatar', avatarInfo);

module.exports = userRouter;